package cn.bxshey.auth.mapper;

import cn.bxshey.auth.domain.pojo.Permissions;
import cn.bxshey.auth.domain.pojo.User;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * @作者：不想说话而已
 * @Date：2023/11/30 21:03
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

   //查询权限信息
   List<Permissions> selectUserPermissions(Long id);

   //根据openid查询用户信息
   User selectByOpenid(String openid);

   //新增用户,返回新增个数
   Integer insertUser(User user);

   /**
    * 更新用户上次登录时间
    * param: 用户id
    */
   Integer updateLoginTimeById(@Param("time") Date time,@Param("uid") Long uid);
}
